3.13.3 \(\int (a+b \tan (e+f x))^3 (c+d \tan (e+f x))^3 \, dx\) [1203]

Optimal. Leaf size=302 \[ -\left ((a c-b d) \left (8 a b c d-a^2 \left (c^2-3 d^2\right )+b^2 \left (3 c^2-d^2\right )\right ) x\right )+\frac {(b c+a d) \left (8 a b c d+b^2 \left (c^2-3 d^2\right )-a^2 \left (3 c^2-d^2\right )\right ) \log (\cos (e+f x))}{f}+\frac {d \left (2 a^3 c d-6 a b^2 c d+3 a^2 b \left (c^2-d^2\right )-b^3 \left (c^2-d^2\right )\right ) \tan (e+f x)}{f}+\frac {\left (3 a^2 b c-b^3 c+a^3 d-3 a b^2 d\right ) (c+d \tan (e+f x))^2}{2 f}+\frac {b \left (3 a^2-b^2\right ) (c+d \tan (e+f x))^3}{3 f}-\frac {b^2 (b c-11 a d) (c+d \tan (e+f x))^4}{20 d^2 f}+\frac {b^2 (a+b \tan (e+f x)) (c+d \tan (e+f x))^4}{5 d f} \]

[Out]

-(a*c-b*d)*(8*a*b*c*d-a^2*(c^2-3*d^2)+b^2*(3*c^2-d^2))*x+(a*d+b*c)*(8*a*b*c*d+b^2*(c^2-3*d^2)-a^2*(3*c^2-d^2))
*ln(cos(f*x+e))/f+d*(2*a^3*c*d-6*a*b^2*c*d+3*a^2*b*(c^2-d^2)-b^3*(c^2-d^2))*tan(f*x+e)/f+1/2*(a^3*d+3*a^2*b*c-
3*a*b^2*d-b^3*c)*(c+d*tan(f*x+e))^2/f+1/3*b*(3*a^2-b^2)*(c+d*tan(f*x+e))^3/f-1/20*b^2*(-11*a*d+b*c)*(c+d*tan(f
*x+e))^4/d^2/f+1/5*b^2*(a+b*tan(f*x+e))*(c+d*tan(f*x+e))^4/d/f

________________________________________________________________________________________

Rubi [A]
time = 0.36, antiderivative size = 302, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3647, 3711, 3609, 3606, 3556} \begin {gather*} \frac {(a d+b c) \left (-\left (a^2 \left (3 c^2-d^2\right )\right )+8 a b c d+b^2 \left (c^2-3 d^2\right )\right ) \log (\cos (e+f x))}{f}-x (a c-b d) \left (-\left (a^2 \left (c^2-3 d^2\right )\right )+8 a b c d+b^2 \left (3 c^2-d^2\right )\right )+\frac {b \left (3 a^2-b^2\right ) (c+d \tan (e+f x))^3}{3 f}+\frac {d \left (2 a^3 c d+3 a^2 b \left (c^2-d^2\right )-6 a b^2 c d-b^3 \left (c^2-d^2\right )\right ) \tan (e+f x)}{f}+\frac {\left (a^3 d+3 a^2 b c-3 a b^2 d-b^3 c\right ) (c+d \tan (e+f x))^2}{2 f}-\frac {b^2 (b c-11 a d) (c+d \tan (e+f x))^4}{20 d^2 f}+\frac {b^2 (a+b \tan (e+f x)) (c+d \tan (e+f x))^4}{5 d f} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + b*Tan[e + f*x])^3*(c + d*Tan[e + f*x])^3,x]

[Out]

-((a*c - b*d)*(8*a*b*c*d - a^2*(c^2 - 3*d^2) + b^2*(3*c^2 - d^2))*x) + ((b*c + a*d)*(8*a*b*c*d + b^2*(c^2 - 3*
d^2) - a^2*(3*c^2 - d^2))*Log[Cos[e + f*x]])/f + (d*(2*a^3*c*d - 6*a*b^2*c*d + 3*a^2*b*(c^2 - d^2) - b^3*(c^2
- d^2))*Tan[e + f*x])/f + ((3*a^2*b*c - b^3*c + a^3*d - 3*a*b^2*d)*(c + d*Tan[e + f*x])^2)/(2*f) + (b*(3*a^2 -
 b^2)*(c + d*Tan[e + f*x])^3)/(3*f) - (b^2*(b*c - 11*a*d)*(c + d*Tan[e + f*x])^4)/(20*d^2*f) + (b^2*(a + b*Tan
[e + f*x])*(c + d*Tan[e + f*x])^4)/(5*d*f)

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3606

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(a*c - b
*d)*x, x] + (Dist[b*c + a*d, Int[Tan[e + f*x], x], x] + Simp[b*d*(Tan[e + f*x]/f), x]) /; FreeQ[{a, b, c, d, e
, f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]

Rule 3609

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[d*
((a + b*Tan[e + f*x])^m/(f*m)), x] + Int[(a + b*Tan[e + f*x])^(m - 1)*Simp[a*c - b*d + (b*c + a*d)*Tan[e + f*x
], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && GtQ[m, 0]

Rule 3647

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Si
mp[b^2*(a + b*Tan[e + f*x])^(m - 2)*((c + d*Tan[e + f*x])^(n + 1)/(d*f*(m + n - 1))), x] + Dist[1/(d*(m + n -
1)), Int[(a + b*Tan[e + f*x])^(m - 3)*(c + d*Tan[e + f*x])^n*Simp[a^3*d*(m + n - 1) - b^2*(b*c*(m - 2) + a*d*(
1 + n)) + b*d*(m + n - 1)*(3*a^2 - b^2)*Tan[e + f*x] - b^2*(b*c*(m - 2) - a*d*(3*m + 2*n - 4))*Tan[e + f*x]^2,
 x], x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0]
&& IntegerQ[2*m] && GtQ[m, 2] && (GeQ[n, -1] || IntegerQ[m]) &&  !(IGtQ[n, 2] && ( !IntegerQ[m] || (EqQ[c, 0]
&& NeQ[a, 0])))

Rule 3711

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (
f_.)*(x_)]^2), x_Symbol] :> Simp[C*((a + b*Tan[e + f*x])^(m + 1)/(b*f*(m + 1))), x] + Int[(a + b*Tan[e + f*x])
^m*Simp[A - C + B*Tan[e + f*x], x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] && NeQ[A*b^2 - a*b*B + a^2*C, 0]
&&  !LeQ[m, -1]

Rubi steps

\begin {align*} \int (a+b \tan (e+f x))^3 (c+d \tan (e+f x))^3 \, dx &=\frac {b^2 (a+b \tan (e+f x)) (c+d \tan (e+f x))^4}{5 d f}+\frac {\int (c+d \tan (e+f x))^3 \left (5 a^3 d-b^2 (b c+4 a d)+5 b \left (3 a^2-b^2\right ) d \tan (e+f x)-b^2 (b c-11 a d) \tan ^2(e+f x)\right ) \, dx}{5 d}\\ &=-\frac {b^2 (b c-11 a d) (c+d \tan (e+f x))^4}{20 d^2 f}+\frac {b^2 (a+b \tan (e+f x)) (c+d \tan (e+f x))^4}{5 d f}+\frac {\int (c+d \tan (e+f x))^3 \left (5 a \left (a^2-3 b^2\right ) d+5 b \left (3 a^2-b^2\right ) d \tan (e+f x)\right ) \, dx}{5 d}\\ &=\frac {b \left (3 a^2-b^2\right ) (c+d \tan (e+f x))^3}{3 f}-\frac {b^2 (b c-11 a d) (c+d \tan (e+f x))^4}{20 d^2 f}+\frac {b^2 (a+b \tan (e+f x)) (c+d \tan (e+f x))^4}{5 d f}+\frac {\int (c+d \tan (e+f x))^2 \left (5 d \left (a^3 c-3 a b^2 c-3 a^2 b d+b^3 d\right )+5 d \left (3 a^2 b c-b^3 c+a^3 d-3 a b^2 d\right ) \tan (e+f x)\right ) \, dx}{5 d}\\ &=\frac {\left (3 a^2 b c-b^3 c+a^3 d-3 a b^2 d\right ) (c+d \tan (e+f x))^2}{2 f}+\frac {b \left (3 a^2-b^2\right ) (c+d \tan (e+f x))^3}{3 f}-\frac {b^2 (b c-11 a d) (c+d \tan (e+f x))^4}{20 d^2 f}+\frac {b^2 (a+b \tan (e+f x)) (c+d \tan (e+f x))^4}{5 d f}+\frac {\int (c+d \tan (e+f x)) \left (-5 d \left (6 a^2 b c d-2 b^3 c d-a^3 \left (c^2-d^2\right )+3 a b^2 \left (c^2-d^2\right )\right )+5 d \left (2 a^3 c d-6 a b^2 c d+3 a^2 b \left (c^2-d^2\right )-b^3 \left (c^2-d^2\right )\right ) \tan (e+f x)\right ) \, dx}{5 d}\\ &=-(a c-b d) \left (8 a b c d-a^2 \left (c^2-3 d^2\right )+b^2 \left (3 c^2-d^2\right )\right ) x+\frac {d \left (2 a^3 c d-6 a b^2 c d+3 a^2 b \left (c^2-d^2\right )-b^3 \left (c^2-d^2\right )\right ) \tan (e+f x)}{f}+\frac {\left (3 a^2 b c-b^3 c+a^3 d-3 a b^2 d\right ) (c+d \tan (e+f x))^2}{2 f}+\frac {b \left (3 a^2-b^2\right ) (c+d \tan (e+f x))^3}{3 f}-\frac {b^2 (b c-11 a d) (c+d \tan (e+f x))^4}{20 d^2 f}+\frac {b^2 (a+b \tan (e+f x)) (c+d \tan (e+f x))^4}{5 d f}+\frac {\left (-5 d^2 \left (6 a^2 b c d-2 b^3 c d-a^3 \left (c^2-d^2\right )+3 a b^2 \left (c^2-d^2\right )\right )+5 c d \left (2 a^3 c d-6 a b^2 c d+3 a^2 b \left (c^2-d^2\right )-b^3 \left (c^2-d^2\right )\right )\right ) \int \tan (e+f x) \, dx}{5 d}\\ &=-(a c-b d) \left (8 a b c d-a^2 \left (c^2-3 d^2\right )+b^2 \left (3 c^2-d^2\right )\right ) x-\frac {(b c+a d) \left (3 a^2 c^2-b^2 c^2-8 a b c d-a^2 d^2+3 b^2 d^2\right ) \log (\cos (e+f x))}{f}+\frac {d \left (2 a^3 c d-6 a b^2 c d+3 a^2 b \left (c^2-d^2\right )-b^3 \left (c^2-d^2\right )\right ) \tan (e+f x)}{f}+\frac {\left (3 a^2 b c-b^3 c+a^3 d-3 a b^2 d\right ) (c+d \tan (e+f x))^2}{2 f}+\frac {b \left (3 a^2-b^2\right ) (c+d \tan (e+f x))^3}{3 f}-\frac {b^2 (b c-11 a d) (c+d \tan (e+f x))^4}{20 d^2 f}+\frac {b^2 (a+b \tan (e+f x)) (c+d \tan (e+f x))^4}{5 d f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains complex when optimal does not.
time = 6.43, size = 299, normalized size = 0.99 \begin {gather*} \frac {b^2 (a+b \tan (e+f x)) (c+d \tan (e+f x))^4}{5 d f}+\frac {-\frac {b^2 (b c-11 a d) (c+d \tan (e+f x))^4}{4 d f}-\frac {5 \left (3 \left (3 a^2 b c-b^3 c-a^3 d+3 a b^2 d\right ) \left ((i c-d)^3 \log (i-\tan (e+f x))-(i c+d)^3 \log (i+\tan (e+f x))+6 c d^2 \tan (e+f x)+d^3 \tan ^2(e+f x)\right )+b \left (3 a^2-b^2\right ) \left (3 i (c+i d)^4 \log (i-\tan (e+f x))-3 i (c-i d)^4 \log (i+\tan (e+f x))-6 d^2 \left (6 c^2-d^2\right ) \tan (e+f x)-12 c d^3 \tan ^2(e+f x)-2 d^4 \tan ^3(e+f x)\right )\right )}{6 f}}{5 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Tan[e + f*x])^3*(c + d*Tan[e + f*x])^3,x]

[Out]

(b^2*(a + b*Tan[e + f*x])*(c + d*Tan[e + f*x])^4)/(5*d*f) + (-1/4*(b^2*(b*c - 11*a*d)*(c + d*Tan[e + f*x])^4)/
(d*f) - (5*(3*(3*a^2*b*c - b^3*c - a^3*d + 3*a*b^2*d)*((I*c - d)^3*Log[I - Tan[e + f*x]] - (I*c + d)^3*Log[I +
 Tan[e + f*x]] + 6*c*d^2*Tan[e + f*x] + d^3*Tan[e + f*x]^2) + b*(3*a^2 - b^2)*((3*I)*(c + I*d)^4*Log[I - Tan[e
 + f*x]] - (3*I)*(c - I*d)^4*Log[I + Tan[e + f*x]] - 6*d^2*(6*c^2 - d^2)*Tan[e + f*x] - 12*c*d^3*Tan[e + f*x]^
2 - 2*d^4*Tan[e + f*x]^3)))/(6*f))/(5*d)

________________________________________________________________________________________

Maple [A]
time = 0.14, size = 495, normalized size = 1.64

method result size
norman \(\left (a^{3} c^{3}-3 a^{3} c \,d^{2}-9 a^{2} b \,c^{2} d +3 a^{2} b \,d^{3}-3 a \,b^{2} c^{3}+9 a \,b^{2} c \,d^{2}+3 b^{3} c^{2} d -b^{3} d^{3}\right ) x +\frac {\left (3 a^{3} c \,d^{2}+9 a^{2} b \,c^{2} d -3 a^{2} b \,d^{3}+3 a \,b^{2} c^{3}-9 a \,b^{2} c \,d^{2}-3 b^{3} c^{2} d +b^{3} d^{3}\right ) \tan \left (f x +e \right )}{f}+\frac {\left (a^{3} d^{3}+9 a^{2} b c \,d^{2}+9 a \,b^{2} c^{2} d -3 a \,b^{2} d^{3}+b^{3} c^{3}-3 b^{3} c \,d^{2}\right ) \left (\tan ^{2}\left (f x +e \right )\right )}{2 f}+\frac {b^{3} d^{3} \left (\tan ^{5}\left (f x +e \right )\right )}{5 f}+\frac {b d \left (3 a^{2} d^{2}+9 a b c d +3 b^{2} c^{2}-b^{2} d^{2}\right ) \left (\tan ^{3}\left (f x +e \right )\right )}{3 f}+\frac {3 b^{2} d^{2} \left (a d +b c \right ) \left (\tan ^{4}\left (f x +e \right )\right )}{4 f}+\frac {\left (3 a^{3} c^{2} d -a^{3} d^{3}+3 a^{2} b \,c^{3}-9 a^{2} b c \,d^{2}-9 a \,b^{2} c^{2} d +3 a \,b^{2} d^{3}-b^{3} c^{3}+3 b^{3} c \,d^{2}\right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 f}\) \(396\)
derivativedivides \(\frac {\frac {b^{3} d^{3} \left (\tan ^{5}\left (f x +e \right )\right )}{5}+\frac {3 a \,b^{2} d^{3} \left (\tan ^{4}\left (f x +e \right )\right )}{4}+\frac {3 b^{3} c \,d^{2} \left (\tan ^{4}\left (f x +e \right )\right )}{4}+a^{2} b \,d^{3} \left (\tan ^{3}\left (f x +e \right )\right )+3 a \,b^{2} c \,d^{2} \left (\tan ^{3}\left (f x +e \right )\right )+b^{3} c^{2} d \left (\tan ^{3}\left (f x +e \right )\right )-\frac {b^{3} d^{3} \left (\tan ^{3}\left (f x +e \right )\right )}{3}+\frac {a^{3} d^{3} \left (\tan ^{2}\left (f x +e \right )\right )}{2}+\frac {9 a^{2} b c \,d^{2} \left (\tan ^{2}\left (f x +e \right )\right )}{2}+\frac {9 a \,b^{2} c^{2} d \left (\tan ^{2}\left (f x +e \right )\right )}{2}-\frac {3 a \,b^{2} d^{3} \left (\tan ^{2}\left (f x +e \right )\right )}{2}+\frac {b^{3} c^{3} \left (\tan ^{2}\left (f x +e \right )\right )}{2}-\frac {3 b^{3} c \,d^{2} \left (\tan ^{2}\left (f x +e \right )\right )}{2}+3 a^{3} c \,d^{2} \tan \left (f x +e \right )+9 a^{2} b \,c^{2} d \tan \left (f x +e \right )-3 a^{2} b \,d^{3} \tan \left (f x +e \right )+3 a \,b^{2} c^{3} \tan \left (f x +e \right )-9 a \,b^{2} c \,d^{2} \tan \left (f x +e \right )-3 b^{3} c^{2} d \tan \left (f x +e \right )+b^{3} d^{3} \tan \left (f x +e \right )+\frac {\left (3 a^{3} c^{2} d -a^{3} d^{3}+3 a^{2} b \,c^{3}-9 a^{2} b c \,d^{2}-9 a \,b^{2} c^{2} d +3 a \,b^{2} d^{3}-b^{3} c^{3}+3 b^{3} c \,d^{2}\right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (a^{3} c^{3}-3 a^{3} c \,d^{2}-9 a^{2} b \,c^{2} d +3 a^{2} b \,d^{3}-3 a \,b^{2} c^{3}+9 a \,b^{2} c \,d^{2}+3 b^{3} c^{2} d -b^{3} d^{3}\right ) \arctan \left (\tan \left (f x +e \right )\right )}{f}\) \(495\)
default \(\frac {\frac {b^{3} d^{3} \left (\tan ^{5}\left (f x +e \right )\right )}{5}+\frac {3 a \,b^{2} d^{3} \left (\tan ^{4}\left (f x +e \right )\right )}{4}+\frac {3 b^{3} c \,d^{2} \left (\tan ^{4}\left (f x +e \right )\right )}{4}+a^{2} b \,d^{3} \left (\tan ^{3}\left (f x +e \right )\right )+3 a \,b^{2} c \,d^{2} \left (\tan ^{3}\left (f x +e \right )\right )+b^{3} c^{2} d \left (\tan ^{3}\left (f x +e \right )\right )-\frac {b^{3} d^{3} \left (\tan ^{3}\left (f x +e \right )\right )}{3}+\frac {a^{3} d^{3} \left (\tan ^{2}\left (f x +e \right )\right )}{2}+\frac {9 a^{2} b c \,d^{2} \left (\tan ^{2}\left (f x +e \right )\right )}{2}+\frac {9 a \,b^{2} c^{2} d \left (\tan ^{2}\left (f x +e \right )\right )}{2}-\frac {3 a \,b^{2} d^{3} \left (\tan ^{2}\left (f x +e \right )\right )}{2}+\frac {b^{3} c^{3} \left (\tan ^{2}\left (f x +e \right )\right )}{2}-\frac {3 b^{3} c \,d^{2} \left (\tan ^{2}\left (f x +e \right )\right )}{2}+3 a^{3} c \,d^{2} \tan \left (f x +e \right )+9 a^{2} b \,c^{2} d \tan \left (f x +e \right )-3 a^{2} b \,d^{3} \tan \left (f x +e \right )+3 a \,b^{2} c^{3} \tan \left (f x +e \right )-9 a \,b^{2} c \,d^{2} \tan \left (f x +e \right )-3 b^{3} c^{2} d \tan \left (f x +e \right )+b^{3} d^{3} \tan \left (f x +e \right )+\frac {\left (3 a^{3} c^{2} d -a^{3} d^{3}+3 a^{2} b \,c^{3}-9 a^{2} b c \,d^{2}-9 a \,b^{2} c^{2} d +3 a \,b^{2} d^{3}-b^{3} c^{3}+3 b^{3} c \,d^{2}\right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (a^{3} c^{3}-3 a^{3} c \,d^{2}-9 a^{2} b \,c^{2} d +3 a^{2} b \,d^{3}-3 a \,b^{2} c^{3}+9 a \,b^{2} c \,d^{2}+3 b^{3} c^{2} d -b^{3} d^{3}\right ) \arctan \left (\tan \left (f x +e \right )\right )}{f}\) \(495\)
risch \(\text {Expression too large to display}\) \(1519\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*tan(f*x+e))^3*(c+d*tan(f*x+e))^3,x,method=_RETURNVERBOSE)

[Out]

1/f*(1/5*b^3*d^3*tan(f*x+e)^5+3/4*a*b^2*d^3*tan(f*x+e)^4+3/4*b^3*c*d^2*tan(f*x+e)^4+a^2*b*d^3*tan(f*x+e)^3+3*a
*b^2*c*d^2*tan(f*x+e)^3+b^3*c^2*d*tan(f*x+e)^3-1/3*b^3*d^3*tan(f*x+e)^3+1/2*a^3*d^3*tan(f*x+e)^2+9/2*a^2*b*c*d
^2*tan(f*x+e)^2+9/2*a*b^2*c^2*d*tan(f*x+e)^2-3/2*a*b^2*d^3*tan(f*x+e)^2+1/2*b^3*c^3*tan(f*x+e)^2-3/2*b^3*c*d^2
*tan(f*x+e)^2+3*a^3*c*d^2*tan(f*x+e)+9*a^2*b*c^2*d*tan(f*x+e)-3*a^2*b*d^3*tan(f*x+e)+3*a*b^2*c^3*tan(f*x+e)-9*
a*b^2*c*d^2*tan(f*x+e)-3*b^3*c^2*d*tan(f*x+e)+b^3*d^3*tan(f*x+e)+1/2*(3*a^3*c^2*d-a^3*d^3+3*a^2*b*c^3-9*a^2*b*
c*d^2-9*a*b^2*c^2*d+3*a*b^2*d^3-b^3*c^3+3*b^3*c*d^2)*ln(1+tan(f*x+e)^2)+(a^3*c^3-3*a^3*c*d^2-9*a^2*b*c^2*d+3*a
^2*b*d^3-3*a*b^2*c^3+9*a*b^2*c*d^2+3*b^3*c^2*d-b^3*d^3)*arctan(tan(f*x+e)))

________________________________________________________________________________________

Maxima [A]
time = 0.59, size = 382, normalized size = 1.26 \begin {gather*} \frac {12 \, b^{3} d^{3} \tan \left (f x + e\right )^{5} + 45 \, {\left (b^{3} c d^{2} + a b^{2} d^{3}\right )} \tan \left (f x + e\right )^{4} + 20 \, {\left (3 \, b^{3} c^{2} d + 9 \, a b^{2} c d^{2} + {\left (3 \, a^{2} b - b^{3}\right )} d^{3}\right )} \tan \left (f x + e\right )^{3} + 30 \, {\left (b^{3} c^{3} + 9 \, a b^{2} c^{2} d + 3 \, {\left (3 \, a^{2} b - b^{3}\right )} c d^{2} + {\left (a^{3} - 3 \, a b^{2}\right )} d^{3}\right )} \tan \left (f x + e\right )^{2} + 60 \, {\left ({\left (a^{3} - 3 \, a b^{2}\right )} c^{3} - 3 \, {\left (3 \, a^{2} b - b^{3}\right )} c^{2} d - 3 \, {\left (a^{3} - 3 \, a b^{2}\right )} c d^{2} + {\left (3 \, a^{2} b - b^{3}\right )} d^{3}\right )} {\left (f x + e\right )} + 30 \, {\left ({\left (3 \, a^{2} b - b^{3}\right )} c^{3} + 3 \, {\left (a^{3} - 3 \, a b^{2}\right )} c^{2} d - 3 \, {\left (3 \, a^{2} b - b^{3}\right )} c d^{2} - {\left (a^{3} - 3 \, a b^{2}\right )} d^{3}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right ) + 60 \, {\left (3 \, a b^{2} c^{3} + 3 \, {\left (3 \, a^{2} b - b^{3}\right )} c^{2} d + 3 \, {\left (a^{3} - 3 \, a b^{2}\right )} c d^{2} - {\left (3 \, a^{2} b - b^{3}\right )} d^{3}\right )} \tan \left (f x + e\right )}{60 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))^3*(c+d*tan(f*x+e))^3,x, algorithm="maxima")

[Out]

1/60*(12*b^3*d^3*tan(f*x + e)^5 + 45*(b^3*c*d^2 + a*b^2*d^3)*tan(f*x + e)^4 + 20*(3*b^3*c^2*d + 9*a*b^2*c*d^2
+ (3*a^2*b - b^3)*d^3)*tan(f*x + e)^3 + 30*(b^3*c^3 + 9*a*b^2*c^2*d + 3*(3*a^2*b - b^3)*c*d^2 + (a^3 - 3*a*b^2
)*d^3)*tan(f*x + e)^2 + 60*((a^3 - 3*a*b^2)*c^3 - 3*(3*a^2*b - b^3)*c^2*d - 3*(a^3 - 3*a*b^2)*c*d^2 + (3*a^2*b
 - b^3)*d^3)*(f*x + e) + 30*((3*a^2*b - b^3)*c^3 + 3*(a^3 - 3*a*b^2)*c^2*d - 3*(3*a^2*b - b^3)*c*d^2 - (a^3 -
3*a*b^2)*d^3)*log(tan(f*x + e)^2 + 1) + 60*(3*a*b^2*c^3 + 3*(3*a^2*b - b^3)*c^2*d + 3*(a^3 - 3*a*b^2)*c*d^2 -
(3*a^2*b - b^3)*d^3)*tan(f*x + e))/f

________________________________________________________________________________________

Fricas [A]
time = 1.32, size = 380, normalized size = 1.26 \begin {gather*} \frac {12 \, b^{3} d^{3} \tan \left (f x + e\right )^{5} + 45 \, {\left (b^{3} c d^{2} + a b^{2} d^{3}\right )} \tan \left (f x + e\right )^{4} + 20 \, {\left (3 \, b^{3} c^{2} d + 9 \, a b^{2} c d^{2} + {\left (3 \, a^{2} b - b^{3}\right )} d^{3}\right )} \tan \left (f x + e\right )^{3} + 60 \, {\left ({\left (a^{3} - 3 \, a b^{2}\right )} c^{3} - 3 \, {\left (3 \, a^{2} b - b^{3}\right )} c^{2} d - 3 \, {\left (a^{3} - 3 \, a b^{2}\right )} c d^{2} + {\left (3 \, a^{2} b - b^{3}\right )} d^{3}\right )} f x + 30 \, {\left (b^{3} c^{3} + 9 \, a b^{2} c^{2} d + 3 \, {\left (3 \, a^{2} b - b^{3}\right )} c d^{2} + {\left (a^{3} - 3 \, a b^{2}\right )} d^{3}\right )} \tan \left (f x + e\right )^{2} - 30 \, {\left ({\left (3 \, a^{2} b - b^{3}\right )} c^{3} + 3 \, {\left (a^{3} - 3 \, a b^{2}\right )} c^{2} d - 3 \, {\left (3 \, a^{2} b - b^{3}\right )} c d^{2} - {\left (a^{3} - 3 \, a b^{2}\right )} d^{3}\right )} \log \left (\frac {1}{\tan \left (f x + e\right )^{2} + 1}\right ) + 60 \, {\left (3 \, a b^{2} c^{3} + 3 \, {\left (3 \, a^{2} b - b^{3}\right )} c^{2} d + 3 \, {\left (a^{3} - 3 \, a b^{2}\right )} c d^{2} - {\left (3 \, a^{2} b - b^{3}\right )} d^{3}\right )} \tan \left (f x + e\right )}{60 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))^3*(c+d*tan(f*x+e))^3,x, algorithm="fricas")

[Out]

1/60*(12*b^3*d^3*tan(f*x + e)^5 + 45*(b^3*c*d^2 + a*b^2*d^3)*tan(f*x + e)^4 + 20*(3*b^3*c^2*d + 9*a*b^2*c*d^2
+ (3*a^2*b - b^3)*d^3)*tan(f*x + e)^3 + 60*((a^3 - 3*a*b^2)*c^3 - 3*(3*a^2*b - b^3)*c^2*d - 3*(a^3 - 3*a*b^2)*
c*d^2 + (3*a^2*b - b^3)*d^3)*f*x + 30*(b^3*c^3 + 9*a*b^2*c^2*d + 3*(3*a^2*b - b^3)*c*d^2 + (a^3 - 3*a*b^2)*d^3
)*tan(f*x + e)^2 - 30*((3*a^2*b - b^3)*c^3 + 3*(a^3 - 3*a*b^2)*c^2*d - 3*(3*a^2*b - b^3)*c*d^2 - (a^3 - 3*a*b^
2)*d^3)*log(1/(tan(f*x + e)^2 + 1)) + 60*(3*a*b^2*c^3 + 3*(3*a^2*b - b^3)*c^2*d + 3*(a^3 - 3*a*b^2)*c*d^2 - (3
*a^2*b - b^3)*d^3)*tan(f*x + e))/f

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 711 vs. \(2 (275) = 550\).
time = 0.27, size = 711, normalized size = 2.35 \begin {gather*} \begin {cases} a^{3} c^{3} x + \frac {3 a^{3} c^{2} d \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} - 3 a^{3} c d^{2} x + \frac {3 a^{3} c d^{2} \tan {\left (e + f x \right )}}{f} - \frac {a^{3} d^{3} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {a^{3} d^{3} \tan ^{2}{\left (e + f x \right )}}{2 f} + \frac {3 a^{2} b c^{3} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} - 9 a^{2} b c^{2} d x + \frac {9 a^{2} b c^{2} d \tan {\left (e + f x \right )}}{f} - \frac {9 a^{2} b c d^{2} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {9 a^{2} b c d^{2} \tan ^{2}{\left (e + f x \right )}}{2 f} + 3 a^{2} b d^{3} x + \frac {a^{2} b d^{3} \tan ^{3}{\left (e + f x \right )}}{f} - \frac {3 a^{2} b d^{3} \tan {\left (e + f x \right )}}{f} - 3 a b^{2} c^{3} x + \frac {3 a b^{2} c^{3} \tan {\left (e + f x \right )}}{f} - \frac {9 a b^{2} c^{2} d \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {9 a b^{2} c^{2} d \tan ^{2}{\left (e + f x \right )}}{2 f} + 9 a b^{2} c d^{2} x + \frac {3 a b^{2} c d^{2} \tan ^{3}{\left (e + f x \right )}}{f} - \frac {9 a b^{2} c d^{2} \tan {\left (e + f x \right )}}{f} + \frac {3 a b^{2} d^{3} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {3 a b^{2} d^{3} \tan ^{4}{\left (e + f x \right )}}{4 f} - \frac {3 a b^{2} d^{3} \tan ^{2}{\left (e + f x \right )}}{2 f} - \frac {b^{3} c^{3} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {b^{3} c^{3} \tan ^{2}{\left (e + f x \right )}}{2 f} + 3 b^{3} c^{2} d x + \frac {b^{3} c^{2} d \tan ^{3}{\left (e + f x \right )}}{f} - \frac {3 b^{3} c^{2} d \tan {\left (e + f x \right )}}{f} + \frac {3 b^{3} c d^{2} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {3 b^{3} c d^{2} \tan ^{4}{\left (e + f x \right )}}{4 f} - \frac {3 b^{3} c d^{2} \tan ^{2}{\left (e + f x \right )}}{2 f} - b^{3} d^{3} x + \frac {b^{3} d^{3} \tan ^{5}{\left (e + f x \right )}}{5 f} - \frac {b^{3} d^{3} \tan ^{3}{\left (e + f x \right )}}{3 f} + \frac {b^{3} d^{3} \tan {\left (e + f x \right )}}{f} & \text {for}\: f \neq 0 \\x \left (a + b \tan {\left (e \right )}\right )^{3} \left (c + d \tan {\left (e \right )}\right )^{3} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))**3*(c+d*tan(f*x+e))**3,x)

[Out]

Piecewise((a**3*c**3*x + 3*a**3*c**2*d*log(tan(e + f*x)**2 + 1)/(2*f) - 3*a**3*c*d**2*x + 3*a**3*c*d**2*tan(e
+ f*x)/f - a**3*d**3*log(tan(e + f*x)**2 + 1)/(2*f) + a**3*d**3*tan(e + f*x)**2/(2*f) + 3*a**2*b*c**3*log(tan(
e + f*x)**2 + 1)/(2*f) - 9*a**2*b*c**2*d*x + 9*a**2*b*c**2*d*tan(e + f*x)/f - 9*a**2*b*c*d**2*log(tan(e + f*x)
**2 + 1)/(2*f) + 9*a**2*b*c*d**2*tan(e + f*x)**2/(2*f) + 3*a**2*b*d**3*x + a**2*b*d**3*tan(e + f*x)**3/f - 3*a
**2*b*d**3*tan(e + f*x)/f - 3*a*b**2*c**3*x + 3*a*b**2*c**3*tan(e + f*x)/f - 9*a*b**2*c**2*d*log(tan(e + f*x)*
*2 + 1)/(2*f) + 9*a*b**2*c**2*d*tan(e + f*x)**2/(2*f) + 9*a*b**2*c*d**2*x + 3*a*b**2*c*d**2*tan(e + f*x)**3/f
- 9*a*b**2*c*d**2*tan(e + f*x)/f + 3*a*b**2*d**3*log(tan(e + f*x)**2 + 1)/(2*f) + 3*a*b**2*d**3*tan(e + f*x)**
4/(4*f) - 3*a*b**2*d**3*tan(e + f*x)**2/(2*f) - b**3*c**3*log(tan(e + f*x)**2 + 1)/(2*f) + b**3*c**3*tan(e + f
*x)**2/(2*f) + 3*b**3*c**2*d*x + b**3*c**2*d*tan(e + f*x)**3/f - 3*b**3*c**2*d*tan(e + f*x)/f + 3*b**3*c*d**2*
log(tan(e + f*x)**2 + 1)/(2*f) + 3*b**3*c*d**2*tan(e + f*x)**4/(4*f) - 3*b**3*c*d**2*tan(e + f*x)**2/(2*f) - b
**3*d**3*x + b**3*d**3*tan(e + f*x)**5/(5*f) - b**3*d**3*tan(e + f*x)**3/(3*f) + b**3*d**3*tan(e + f*x)/f, Ne(
f, 0)), (x*(a + b*tan(e))**3*(c + d*tan(e))**3, True))

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 8276 vs. \(2 (301) = 602\).
time = 5.78, size = 8276, normalized size = 27.40 \begin {gather*} \text {Too large to display} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))^3*(c+d*tan(f*x+e))^3,x, algorithm="giac")

[Out]

1/60*(60*a^3*c^3*f*x*tan(f*x)^5*tan(e)^5 - 180*a*b^2*c^3*f*x*tan(f*x)^5*tan(e)^5 - 540*a^2*b*c^2*d*f*x*tan(f*x
)^5*tan(e)^5 + 180*b^3*c^2*d*f*x*tan(f*x)^5*tan(e)^5 - 180*a^3*c*d^2*f*x*tan(f*x)^5*tan(e)^5 + 540*a*b^2*c*d^2
*f*x*tan(f*x)^5*tan(e)^5 + 180*a^2*b*d^3*f*x*tan(f*x)^5*tan(e)^5 - 60*b^3*d^3*f*x*tan(f*x)^5*tan(e)^5 - 90*a^2
*b*c^3*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e)
 + 1)/(tan(e)^2 + 1))*tan(f*x)^5*tan(e)^5 + 30*b^3*c^3*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(
f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^5*tan(e)^5 - 90*a^3*c^2*d*log(4
*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e
)^2 + 1))*tan(f*x)^5*tan(e)^5 + 270*a*b^2*c^2*d*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*
tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^5*tan(e)^5 + 270*a^2*b*c*d^2*log(4*(ta
n(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2
+ 1))*tan(f*x)^5*tan(e)^5 - 90*b^3*c*d^2*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^
2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^5*tan(e)^5 + 30*a^3*d^3*log(4*(tan(f*x)^4*tan
(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*
x)^5*tan(e)^5 - 90*a*b^2*d^3*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)
^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^5*tan(e)^5 - 300*a^3*c^3*f*x*tan(f*x)^4*tan(e)^4 + 900*a*
b^2*c^3*f*x*tan(f*x)^4*tan(e)^4 + 2700*a^2*b*c^2*d*f*x*tan(f*x)^4*tan(e)^4 - 900*b^3*c^2*d*f*x*tan(f*x)^4*tan(
e)^4 + 900*a^3*c*d^2*f*x*tan(f*x)^4*tan(e)^4 - 2700*a*b^2*c*d^2*f*x*tan(f*x)^4*tan(e)^4 - 900*a^2*b*d^3*f*x*ta
n(f*x)^4*tan(e)^4 + 300*b^3*d^3*f*x*tan(f*x)^4*tan(e)^4 + 30*b^3*c^3*tan(f*x)^5*tan(e)^5 + 270*a*b^2*c^2*d*tan
(f*x)^5*tan(e)^5 + 270*a^2*b*c*d^2*tan(f*x)^5*tan(e)^5 - 135*b^3*c*d^2*tan(f*x)^5*tan(e)^5 + 30*a^3*d^3*tan(f*
x)^5*tan(e)^5 - 135*a*b^2*d^3*tan(f*x)^5*tan(e)^5 + 450*a^2*b*c^3*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*ta
n(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^4*tan(e)^4 - 150*b^3
*c^3*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) +
 1)/(tan(e)^2 + 1))*tan(f*x)^4*tan(e)^4 + 450*a^3*c^2*d*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan
(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^4*tan(e)^4 - 1350*a*b^2*c^2*d*
log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(
tan(e)^2 + 1))*tan(f*x)^4*tan(e)^4 - 1350*a^2*b*c*d^2*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f
*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^4*tan(e)^4 + 450*b^3*c*d^2*log(4
*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e
)^2 + 1))*tan(f*x)^4*tan(e)^4 - 150*a^3*d^3*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(
e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^4*tan(e)^4 + 450*a*b^2*d^3*log(4*(tan(f*x)
^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*
tan(f*x)^4*tan(e)^4 - 180*a*b^2*c^3*tan(f*x)^5*tan(e)^4 - 540*a^2*b*c^2*d*tan(f*x)^5*tan(e)^4 + 180*b^3*c^2*d*
tan(f*x)^5*tan(e)^4 - 180*a^3*c*d^2*tan(f*x)^5*tan(e)^4 + 540*a*b^2*c*d^2*tan(f*x)^5*tan(e)^4 + 180*a^2*b*d^3*
tan(f*x)^5*tan(e)^4 - 60*b^3*d^3*tan(f*x)^5*tan(e)^4 - 180*a*b^2*c^3*tan(f*x)^4*tan(e)^5 - 540*a^2*b*c^2*d*tan
(f*x)^4*tan(e)^5 + 180*b^3*c^2*d*tan(f*x)^4*tan(e)^5 - 180*a^3*c*d^2*tan(f*x)^4*tan(e)^5 + 540*a*b^2*c*d^2*tan
(f*x)^4*tan(e)^5 + 180*a^2*b*d^3*tan(f*x)^4*tan(e)^5 - 60*b^3*d^3*tan(f*x)^4*tan(e)^5 + 600*a^3*c^3*f*x*tan(f*
x)^3*tan(e)^3 - 1800*a*b^2*c^3*f*x*tan(f*x)^3*tan(e)^3 - 5400*a^2*b*c^2*d*f*x*tan(f*x)^3*tan(e)^3 + 1800*b^3*c
^2*d*f*x*tan(f*x)^3*tan(e)^3 - 1800*a^3*c*d^2*f*x*tan(f*x)^3*tan(e)^3 + 5400*a*b^2*c*d^2*f*x*tan(f*x)^3*tan(e)
^3 + 1800*a^2*b*d^3*f*x*tan(f*x)^3*tan(e)^3 - 600*b^3*d^3*f*x*tan(f*x)^3*tan(e)^3 + 30*b^3*c^3*tan(f*x)^5*tan(
e)^3 + 270*a*b^2*c^2*d*tan(f*x)^5*tan(e)^3 + 270*a^2*b*c*d^2*tan(f*x)^5*tan(e)^3 - 90*b^3*c*d^2*tan(f*x)^5*tan
(e)^3 + 30*a^3*d^3*tan(f*x)^5*tan(e)^3 - 90*a*b^2*d^3*tan(f*x)^5*tan(e)^3 - 90*b^3*c^3*tan(f*x)^4*tan(e)^4 - 8
10*a*b^2*c^2*d*tan(f*x)^4*tan(e)^4 - 810*a^2*b*c*d^2*tan(f*x)^4*tan(e)^4 + 495*b^3*c*d^2*tan(f*x)^4*tan(e)^4 -
 90*a^3*d^3*tan(f*x)^4*tan(e)^4 + 495*a*b^2*d^3*tan(f*x)^4*tan(e)^4 + 30*b^3*c^3*tan(f*x)^3*tan(e)^5 + 270*a*b
^2*c^2*d*tan(f*x)^3*tan(e)^5 + 270*a^2*b*c*d^2*tan(f*x)^3*tan(e)^5 - 90*b^3*c*d^2*tan(f*x)^3*tan(e)^5 + 30*a^3
*d^3*tan(f*x)^3*tan(e)^5 - 90*a*b^2*d^3*tan(f*x)^3*tan(e)^5 - 60*b^3*c^2*d*tan(f*x)^5*tan(e)^2 - 180*a*b^2*c*d
^2*tan(f*x)^5*tan(e)^2 - 60*a^2*b*d^3*tan(f*x)^...

________________________________________________________________________________________

Mupad [B]
time = 5.38, size = 494, normalized size = 1.64 \begin {gather*} \frac {\mathrm {tan}\left (e+f\,x\right )\,\left (b^3\,d^3+3\,a\,c\,\left (a^2\,d^2+3\,a\,b\,c\,d+b^2\,c^2\right )-3\,b\,d\,\left (a^2\,d^2+3\,a\,b\,c\,d+b^2\,c^2\right )\right )}{f}-\frac {\ln \left ({\mathrm {tan}\left (e+f\,x\right )}^2+1\right )\,\left (-\frac {3\,a^3\,c^2\,d}{2}+\frac {a^3\,d^3}{2}-\frac {3\,a^2\,b\,c^3}{2}+\frac {9\,a^2\,b\,c\,d^2}{2}+\frac {9\,a\,b^2\,c^2\,d}{2}-\frac {3\,a\,b^2\,d^3}{2}+\frac {b^3\,c^3}{2}-\frac {3\,b^3\,c\,d^2}{2}\right )}{f}-\frac {{\mathrm {tan}\left (e+f\,x\right )}^3\,\left (\frac {b^3\,d^3}{3}-b\,d\,\left (a^2\,d^2+3\,a\,b\,c\,d+b^2\,c^2\right )\right )}{f}+\frac {{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (\frac {a^3\,d^3}{2}+\frac {b^3\,c^3}{2}-\frac {3\,b^2\,d^2\,\left (a\,d+b\,c\right )}{2}+\frac {9\,a\,b^2\,c^2\,d}{2}+\frac {9\,a^2\,b\,c\,d^2}{2}\right )}{f}+\frac {\mathrm {atan}\left (\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (a\,c-b\,d\right )\,\left (-a^2\,c^2+3\,a^2\,d^2+8\,a\,b\,c\,d+3\,b^2\,c^2-b^2\,d^2\right )}{a^3\,c^3-3\,a^3\,c\,d^2-9\,a^2\,b\,c^2\,d+3\,a^2\,b\,d^3-3\,a\,b^2\,c^3+9\,a\,b^2\,c\,d^2+3\,b^3\,c^2\,d-b^3\,d^3}\right )\,\left (a\,c-b\,d\right )\,\left (-a^2\,c^2+3\,a^2\,d^2+8\,a\,b\,c\,d+3\,b^2\,c^2-b^2\,d^2\right )}{f}+\frac {b^3\,d^3\,{\mathrm {tan}\left (e+f\,x\right )}^5}{5\,f}+\frac {3\,b^2\,d^2\,{\mathrm {tan}\left (e+f\,x\right )}^4\,\left (a\,d+b\,c\right )}{4\,f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*tan(e + f*x))^3*(c + d*tan(e + f*x))^3,x)

[Out]

(tan(e + f*x)*(b^3*d^3 + 3*a*c*(a^2*d^2 + b^2*c^2 + 3*a*b*c*d) - 3*b*d*(a^2*d^2 + b^2*c^2 + 3*a*b*c*d)))/f - (
log(tan(e + f*x)^2 + 1)*((a^3*d^3)/2 + (b^3*c^3)/2 - (3*a^2*b*c^3)/2 - (3*a*b^2*d^3)/2 - (3*a^3*c^2*d)/2 - (3*
b^3*c*d^2)/2 + (9*a*b^2*c^2*d)/2 + (9*a^2*b*c*d^2)/2))/f - (tan(e + f*x)^3*((b^3*d^3)/3 - b*d*(a^2*d^2 + b^2*c
^2 + 3*a*b*c*d)))/f + (tan(e + f*x)^2*((a^3*d^3)/2 + (b^3*c^3)/2 - (3*b^2*d^2*(a*d + b*c))/2 + (9*a*b^2*c^2*d)
/2 + (9*a^2*b*c*d^2)/2))/f + (atan((tan(e + f*x)*(a*c - b*d)*(3*a^2*d^2 - a^2*c^2 + 3*b^2*c^2 - b^2*d^2 + 8*a*
b*c*d))/(a^3*c^3 - b^3*d^3 - 3*a*b^2*c^3 + 3*a^2*b*d^3 - 3*a^3*c*d^2 + 3*b^3*c^2*d + 9*a*b^2*c*d^2 - 9*a^2*b*c
^2*d))*(a*c - b*d)*(3*a^2*d^2 - a^2*c^2 + 3*b^2*c^2 - b^2*d^2 + 8*a*b*c*d))/f + (b^3*d^3*tan(e + f*x)^5)/(5*f)
 + (3*b^2*d^2*tan(e + f*x)^4*(a*d + b*c))/(4*f)

________________________________________________________________________________________